package kr.ac.chungbuk;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class ItemController {
	ArrayList<ItemDTO> itemList = new ArrayList<ItemDTO>();
	IBoardDAO ibaties = new IBoardDAO();
	@RequestMapping("items")
	public ModelAndView items(ModelAndView mav){
		List list=ibaties.selectAllItem();
		mav.addObject("itemList", list);
		mav.setViewName("../views/items/items");
		return mav;
	}
	@RequestMapping("detailItem")
	public ModelAndView detailItem(String item_Name, ModelAndView mav){
		ItemDTO list=ibaties.selectOneItem(item_Name);
		mav.setViewName("../views/items/detailItem");
		mav.addObject("itemList",list);
		return mav;
	}
}
